Skip to content

Move revealjs scroll-view from extraConfig to template#14100

Merged
cderv merged 7 commits intomainfrom
fix/issue-13852
Feb 24, 2026
Merged

Move revealjs scroll-view from extraConfig to template#14100
cderv merged 7 commits intomainfrom
fix/issue-13852

Conversation

@cderv
Copy link
Copy Markdown
Member

@cderv cderv commented Feb 24, 2026

Quarto's scroll-view support (PR #11034) predates Pandoc 3.8.3's native revealjs scroll-view template support and uses runtime JavaScript injection (extraConfig) as a workaround. The scroll-view options are now rendered directly by Quarto's template.html using $if/$else$ type guards.

Approach

Scroll-view configuration flows through three stages:

  1. revealResolveFormat() normalizes YAML keys and creates a scrollProgressAuto helper flag (Pandoc templates can't distinguish "auto" from true since both are truthy)
  2. formatExtras() sets scroll-view defaults in extras.metadata (lowest priority, overridden by user values)
  3. template.html renders values with type-safe guards — strings quoted, booleans unquoted, numbers unquoted

The extraConfig injection block in formatExtras() is removed entirely.

Type handling

Pandoc's own revealjs template (jgm/pandoc#11486) has type bugs: scrollSnap: 'false' renders as a truthy string instead of boolean false, and scrollActivationWidth renders as a string instead of a number. Quarto's template handles these correctly via $if/$else$ branching.

Tests

10 smoke tests in tests/docs/smoke-all/revealjs/scroll-view/ cover all option combinations: defaults, scrollProgress (true/false/auto), scrollSnap (mandatory/proximity/false), scrollActivationWidth (non-zero), direct view: scroll key, and a negative test verifying scroll options are absent without scroll-view.

Closes #13852

cderv and others added 5 commits February 23, 2026 20:36
Scroll-view options were injected at runtime via extraConfig (JS post-
processing). Now they are rendered directly by template.html, matching
how other revealjs options are handled.

The template uses $if/$else$ guards to render correct JS types for
mixed-type options (scrollSnap accepts strings and boolean false,
scrollProgress accepts booleans and string 'auto'). This fixes type
issues present in Pandoc's upstream template (jgm/pandoc#11486).

Closes #13852

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Covers two additional edge cases:
- view: scroll set directly (not via scroll-view shorthand)
- scroll-view.progress: true (boolean true, not "auto")

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verifies numeric rendering of scrollActivationWidth with a user-specified
value (600) rather than only testing the default (0).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verifies that scrollActivationWidth, scrollSnap, scrollLayout, and
scrollProgress do NOT appear in output when scroll-view is not configured.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Group all scroll-view smoke tests under revealjs/scroll-view/ to keep
the revealjs test directory organized as coverage grows.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@posit-snyk-bot
Copy link
Copy Markdown
Collaborator

posit-snyk-bot commented Feb 24, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv cderv merged commit 4c60a3e into main Feb 24, 2026
51 checks passed
@cderv cderv deleted the fix/issue-13852 branch February 24, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check pandoc 3.8.3 scroll view option support for revealjs

2 participants